#include <stdint.h>

#include "utils.h"

int timespecDiffMs(struct timespec *end, struct timespec *start)
{
  int64_t diff_ns = (end->tv_sec * 1000000000) + end->tv_nsec -
               ((start->tv_sec * 1000000000) + start->tv_nsec);
  return ((diff_ns + 500) / 1000000);
}
